Learning Objectives

After completing this lesson, you’ll be able to:

Resources

Best Practice

If a workspace runs to completion and produces the output you want, it can’t be wrong, right? Well, yes, it can. It's not enough to assemble a functioning workspace; it's also vital to use FME efficiently and cost-effectively.

In general terms, best practice means the best way of doing something; in other words, carrying out a task effectively and efficiently.

Despite the word 'best,' we're not presuming the ideas here will meet every need and occasion. The best description of this concept I've heard – and one that fits well here – is:

A very good practice to consider in this situation, based on experience and analysis.

Why Use Best Practice?

Best practice in FME can help a user to…

Note

I learned about best practices the hard way when I had to work on someone else’s workspaces. My colleague had organized the workspaces so poorly that the operation took me three times as long as it should have!

In this course, we’ll provide a guide to the preferred design for workspaces. The correct style makes a workspace easier to interpret, particularly in the long run when the author might return to it after a period of inactivity.

An FME Workspace Style Guide

“A good-looking, well-organized workspace gives the customer the feeling that you have done quality work.”

Style is the most apparent component of FME Best Practice. You can tell at a glance when a workspace is well-styled and when it is not. As the quote above implies, a well-designed workspace demonstrates competence.

However, style is more than looks; an adequately designed workspace provides many benefits as it is further developed and edited in the future.

Good style makes it easier to navigate and understand an existing workspace. Design is essential when workspaces might need to be edited by other users or when you intend to make edits yourself later.

Specifically, a good style can help a user to…

Example of Poor Design

Do you need proof? Would you want to be given the task of editing this workspace? Can you even tell what this section does or—more importantly—why?

Messy workspace example

Note

You should always use best practices, whether for a small workspace, training exercise, or large-scale project. Getting into the habit helps make your smaller projects scalable.

If you don't design a workspace well from the start, it will be more challenging to make edits as you work on it.

Object Layout

Positioning workspace objects and connecting them with care can make the difference between a poorly designed workspace and one that is visually attractive and efficient.

Layout methods vary from user to user. Some users like to line up objects so that all connections are horizontal:

Using straight connection lines

Others prefer the tops of objects to be aligned horizontally, with angled connections:

Aligning the top of objects

Some prefer to align object edges vertically:

Aligning the left side of objects

Some FME users use a mixed style, aligning the tops of sections of their workspace, but then aligning objects within these sections vertically. This style allows you to fit many transformers onto a single part of the screen, making more of the workspace visible at a glance. It counteracts the tendency for workspaces to become very long horizontally. Here's an example:

Mixing horizontal and vertical alignment

Your style is more of a personal preference than a definite rule, but consistency is essential. A workspace with no apparent layout style or an inconsistent one does not inspire confidence in the author's abilities!

Grid and Guides

Grids and Guides are tools for aligning workspace objects neatly and tidily. You can access this functionality through View > Grid and Guides on the Workbench menu bar.

Accessing Grids and Guides options

Show Grid displays a grid of lines on the Workbench canvas. Snap to Grid causes all objects, such as the KMLStyler highlighted, to snap onto the intersection of grid lines when moved. In this way, you can more easily line up objects.

Aligning objects using the grid

Show Guides displays guidelines on the Workbench canvas whenever an object is moved, helping you align it with other canvas objects. Snap to Guides snaps an object onto a highlighted guideline. Guides are enabled by default.

Aligning objects using guides

These two tools make it very simple to align workspace objects in a pleasing style.

Auto-Layout

The Auto-Layout tool is available on the toolbar of FME Workbench:

Autolayout button on the toolbar

You may need to add the tool to your toolbar. To do so, right-click the toolbar and choose Customize Toolbar. Then, find it under Tools> Apply Auto-Layout. 

Auto-Layout is also found in the Tools menu.

Clicking the toolbar button will lay out either all of the workspace or just the objects that are currently selected:

Autolayout applied to a workspace

As you can see, Auto-Layout tends to use a horizontal pattern, with the tops of objects aligned. Therefore, it's better to select groups of transformers and run the tool on them rather than try to lay out the entire workspace in a single action.

Exercise

Jennifer

Jennifer would like to improve an old workspace she created when she was an FME beginner. The workspaces calculates a walkability score for each address in the city of Vancouver.

She needs to tidy it up. Before she does that, though, she needs to remind herself how the workspace works and list the problems to fix.

1) Start Workbench

She opens the starting workspace (C:\FMEData\Workspaces\UseDataIntegrationBestPractices\design-readable-workspaces.fmw) with FME Workbench 2025.0.1 or later.

It's a real mess! She didn't know FME best practice when she created it.

2) Examine Workspace

The workspace is unorganized. Jennifer examines it in sections to figure out how it works.

Starting workspace annotated with numbers

  1. PostalAddress and PostcodeBoundaries read from Addresses.gdb.
  2. Transformers clean up attributes from the PostalAddress feature type to create a separate Number and Street attribute. The last two digits of the Number are replaced by XX to create an attribute that will be the Join Key for joining the crime data.
  3. Crime reads from Crime.csv. This dataset stores the street number for each crime incident with XX as the last two digits to protect anonymity.
  4. The FeatureJoiner joins PostalAddress and the Crime data based on the Join Key attribute from section two and the Block attribute from Crime.
  5. These transformers give the crime Type attribute a number based on severity and then calculate the total CrimeValue for each address block. Then, the CenterPointReplacer extracts only one point if multiple crime incidents occur in the same location.
  6. The workspace reads the Parks MapInfo TAB file. It will use this data to measure the walking distance from addresses to parks.
  7. The NeighborFinder determines the park closest to each address.
  8. The AttributeRenamer renames the _distance attribute from the NeighborFinder to ParkDistance.
  9. The Creator and the FeatureReader read a Planning Restrictions OGC Geopackage, including noise restriction areas from the NoiseControlAreas layer.
  10. The PointOnAreaOverlayer joins the point data containing the crime, distance to park, and addresses with the NoiseControlAreas polygons. This joined data assigns the noise restrictions to any overlapping points. The AttributeValueMapper assigns the zone a score, creating the attribute NoiseZoneScore. This new attribute will reflect that addresses in noise-restricted areas are more walkable.

3) List Style Problems

Jennifer takes notes of style problems with this workspace.

Help her out; make a list of the main things you'd like to fix to make the workspace more readable.

Note

You don't need to fix these issues yet; we'll go over the steps to do so in later lessons. For now, just note the problems.

If you are taking a Safe Software-hosted training course, feel free to share the style issues you identify with the chat.